package com.example.android.chartapplication.Fragments;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.android.chartapplication.ChartLine;
import com.example.android.chartapplication.R;

import java.util.Random;

public class ChartLineFragment extends Fragment {

    ChartLine chartLine;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view =  inflater.inflate(R.layout.fragment_chart_line, container, false);
        chartLine = view.findViewById(R.id.chartLine);
        return view;
    }

    @Override
    public void onStart() {
        super.onStart();

        Random random = new Random();
        for (int i = 0; i < 30; i++) {
            chartLine.addData(random.nextInt(100));
        }
    }
}
